; Music of Netherworld (1988) (Hewson) (Dave Rogers)
; Ripped by Megachur on 17/11/2006

	write "NETHERWO.BIN"

music_date_rip	equ &11b6
music_adr	equ &aaa1
first_theme	equ 0
last_theme	equ 0	; e=&1f other little theme

	read "music_header_v1_0.asm"

; NETHERSD.ASM   V 11.0  NETHERWORLD Sound Driver (AMSTRAD/SPEC.128)  DavRog,1988


;******************************************************
SPECVERSION  EQU   0                ;0=AMSTRAD 1=SPEC

SOUNDCOD     EQU   music_begin	;32768            ;MACHINE CODE

;SOUNDATA     EQU   SOUNDCOD + 1100   ;DATABLOCK ADDRESS
;******************************************************
           
             NOLIST

ENVSINDEX    EQU       SOUNDATA+200
TUNESINDEX   EQU       ENVSINDEX+100

ENVCOUNTS    EQU 0
ENTCOUNTS    EQU 2
ENVPTR       EQU 4
ENTPTR       EQU 6
ENV0         EQU 8
ENT0         EQU 10
ENVADR       EQU 12
ENTADR       EQU 14

CHANACTIVE   EQU 16
MAINCOUNT    EQU 17
DATAPTR      EQU 18
CONPTR       EQU 20
PTRREFR      EQU 22
PITCHSHIFT   EQU 24
NOISEDIS     EQU 25
CH_ENABLE    EQU 26
INTERVAL     EQU 27
CURRENTNOTE  EQU 28
CHORDTOGGLE  EQU 29
CURRENTDUR   EQU 30
volbalflag   equ 31

;                ORG  SOUNDCOD
;*****
;IF SPECVERSION
;                WRITE "SPECCOD.BIN"
;ELSE
;                WRITE "NETHERSD.BIN"
;ENDIF
;*****

START           DEFL $

;---------------------------------------
JUMPBLOCK:      JP PLAY25th
                JP SILENCE
                JP PLAY50TH
;spec48flag      DB 0
;
.init_music
;
BASICSTART:     LD E,1
                LD C,1
                jp dosound
time48_1        dw 00
time48_2        dw 00
time48_3        dw 00
key48           db 0
temper48        db 0
;                JP INTRO48
;                JP INGAME48
effvol          db 0
tunvol          db 0

;----------------------
DOSOUND:        CALL FINDBLOC      ;E=BLOC   HL=BLOCADR
                LD A,(HL)          ;C=CHAN   B=PRIORITY
                CP 9
                JR NC,NOCHANMARKER
                LD C,A
                INC HL
                LD A,(HL)
NOCHANMARKER:   CP 244
                LD B,10
                JR NZ,NOPRIMARKER
                INC HL
                LD B,(HL)
                INC HL
NOPRIMARKER     DEC C              ;FINDCHAN
                JR Z,TRY1
                DEC C
                JR Z,TRY2
                DEC C
                JR Z,TRY3           ;4=CHANALT
CHANALT:        LD A,(STORE1+CHANACTIVE)   ;chan 1 if poss.
                OR A
                JR Z,TRY1
                LD A,(STORE2+CHANACTIVE)
                OR A
                JR Z,TRY2
                JR TRY3                    ;else chan 3

TRY1:           LD DE,STORE1+CHANACTIVE
                LD A,(DE)
                LD C,A
                LD A,B
                SUB C
                RET C                   ;priority too low
                XOR A
                LD (DE),A               ;chan off while reset
                LD (STORE1+INTERVAL),A
                LD (STORE1+PITCHSHIFT),A
                ld (store1+volbalflag),a
                INC A
                LD (STORE1+MAINCOUNT),A
                LD (STORE1+DATAPTR),HL
                LD (STORE1+CONPTR),HL
                LD (STORE1+PTRREFR),HL
                LD A,B
                LD (DE),A
                RET

TRY2:           LD DE,STORE2+CHANACTIVE
                LD A,(DE)
                LD C,A
                LD A,B
                SUB C
                RET C
                XOR A
                LD (DE),A
                LD (STORE2+INTERVAL),A
                LD (STORE2+PITCHSHIFT),A
                ld (store2+volbalflag),a
                INC A
                LD (STORE2+MAINCOUNT),A
                LD (STORE2+DATAPTR),HL
                LD (STORE2+CONPTR),HL
                LD (STORE2+PTRREFR),HL
                LD A,B
                LD (DE),A
                RET

TRY3:           LD DE,STORE3+CHANACTIVE
                LD A,(DE)
                LD C,A
                LD A,B
                SUB C
                RET C
                XOR A
                LD (DE),A
                LD (STORE3+INTERVAL),A
                LD (STORE3+PITCHSHIFT),A
                ld (store3+volbalflag),a
                INC A
                LD (STORE3+MAINCOUNT),A
                LD (STORE3+DATAPTR),HL
                LD (STORE3+CONPTR),HL
                LD (STORE3+PTRREFR),HL
                LD A,B
                LD (DE),A
                RET

;------
;
.stop_music
;
SILENCE:        LD HL,255*256+255
                LD (STORE1+CHANACTIVE),HL  ;MAINCOUNT ALSO 255
                LD (STORE2+CHANACTIVE),HL
                LD (STORE3+CHANACTIVE),HL
                XOR A
                LD (OVERIDER+1),A         ;ESSENTIAL!!!!
                LD (NSEFLAG),A
                LD (BUFF+8),A
                LD (BUFF+9),A
                LD (BUFF+10),A
                LD (STORE1+CHANACTIVE),A
                LD (STORE2+CHANACTIVE),A
                LD (STORE3+CHANACTIVE),A
                LD A, %00111111          ;ALL GATES SHUT
                LD (BUFF+7),A
;***********
IF SPECVERSION
ALL13REGS:      LD HL,BUFF+13
                LD E,13
                XOR A
                JP NEXTREG
ELSE
ALL13REGS:      LD HL,BUFF+13
                LD DE,#F40D   ;13
                XOR A
                JP NEXTREG    ;RETS FROM THERE
ENDIF
;*******************

FINDBLOC:       LD   A,E
                ADD  A,A
                ADD  A,TUNESINDEX AND #00FF
                LD   L,A
                ADC  A,TUNESINDEX AND #FF00 /256
                SUB  L
                LD   H,A
                LD   E,(HL)
                INC  HL
                LD   D,(HL)
                LD HL,SOUNDATA
                ADD HL,DE
                RET

FINDENV:        LD   A,E                ;must not corrupt hl
                ADD  A,A
                ADD  A,ENVSINDEX AND #00FF
                LD   E,A
                ADC  A,ENVSINDEX AND #FF00 / 256
                SUB  E
                LD   D,A   ;-----
                LD  A,(DE)
                ADD A,SOUNDATA AND #00FF
                LD  C,A   ;-----
                INC  DE
                LD  A,(DE)
                ADC A,SOUNDATA AND #FF00 / 256
                LD B,A
                RET

;-------------------------------------PLAY-------------
PLAY25TH        CALL PLAYGEN
                JP ALLREGIST
;
.play_music
PLAY50TH
;
	        LD A,0-0
                XOR 1
                LD (PLAY50TH+1),A
                JR Z,PART2
PART1           JP PLAYGEN    ;RETS FROM THERE
PART2           JP ALLREGIST

;-------
PLAYGEN         LD A,(STORE1+CHANACTIVE)
                OR A
                JR Z,C2
                LD  IX,STORE1
                LD IY,BUFF+8
                LD HL,(BUFF)
                LD (PITCHTEMP),HL
                LD HL,(STORE1+DATAPTR)
                CALL TESTCHAN
                LD (BUFF),HL

C2:             LD A,(STORE2+CHANACTIVE)
                OR A
                JR Z,C3
                LD  IX,STORE2
                LD IY,BUFF+9
                LD HL,(BUFF+2)
                LD (PITCHTEMP),HL
                LD HL,(STORE2+DATAPTR)
                CALL TESTCHAN
                LD (BUFF+2),HL

C3:             LD A,(STORE3+CHANACTIVE)
                OR A
                JR Z,C4
                LD IX,STORE3
                LD IY,BUFF+10
                LD HL,(BUFF+4)
                LD (PITCHTEMP),HL
                LD HL,(STORE3+DATAPTR)
                CALL TESTCHAN
                LD (BUFF+4),HL

C4              JP DOENSE   ;RETS FROM THERE

;***************
IF SPECVERSION

ALLREGIST:      XOR A
                LD HL,BUFF+10
                LD E,10
NEXTREG:        LD BC,65533
                OUT (C),E
                LD BC,49149
                LD A,(HL)      
                DEC HL
                OUT (C),A
                DEC E
                JP P,NEXTREG
                RET
ELSE

ALLREGIST:      XOR  A
                LD   HL,BUFF+10  ;10
                LD   DE,#F40A    ;10
NEXTREG:        LD   B,D
                OUT  (C),E
                LD   BC,63168    ;(#F6*256+%11000000)
                OUT  (C),C
                OUT  (C),A
                LD   B,D
                LD   C,(HL)
                DEC  HL
                OUT  (C),C
                LD   BC,63104    ;(#F6*256+%10000000)
                OUT  (C),C
                OUT  (C),A
                DEC  E
                JP   P,NEXTREG
                RET

ENDIF
;*************

;FOR EACH OF THE 3 CHANNELS:

TESTCHAN:       DEC  (IX+MAINCOUNT)
                JP NZ,DOENV_ENT

                LD A,20
                LD (DECI+1),A        ;INIT.STOPHANG (STOPS POSSIBLE HANG-UPS)

DECI            LD A,0-0             ;SELF-MOD
                DEC A
                LD (DECI+1),A
                RET Z

                LD   A,(HL)
                INC  HL
                LD   E,(HL)
                INC HL

SUBSELECT    OR A
 
             JP   Z,DOPAUSE
             CP   6
             JR   C,STARTLOOP
             CP   101
             JP   C,NEWNOTE
             CP   228
             JP   C,COMPNOTE
             CP   255
             JP   Z,RETCONBLOC
             CP   244
             JR   Z,NEWPRIORITY

             SUB 230
             JR  Z,NOISE
             DEC A
             JR  Z,NOISENOCHECK
             DEC A
             JR  Z,QUICKOUT
             DEC A
             JR  Z,NEWENV
             DEC A
             JR  Z,NEWENT
             DEC A
             JR  Z,NEWENSE
             DEC A
             JP  Z,SETINTERVAL
             DEC A
             JR  Z,NEWKEY
             DEC A
             JR  Z,GONEWBLOC
             DEC A
             jr z,volbalonoff
             DEC A
             JP Z,OVERIDE

             ;any other val=FOLLOW THROUGH=SAFETY NET

KILLCHAN:       LD (IX+CHANACTIVE),0
                LD (IY+0),0             ;CH VOL
                RET

volbalonoff     ld (ix+volbalflag),e
                jp deci

NEWPRIORITY:    LD (IX+CHANACTIVE),E
                JP DECI

QUICKOUT:       LD (IX+MAINCOUNT),1     ;TIME SHARER
                DEC HL
                LD (IX+DATAPTR),L
                LD (IX+DATAPTR+1),H
                LD HL,0
                RET

STARTLOOP:      PUSH HL
                LD C,A             ;C=CHAN
                CALL DOSOUND
                POP HL    
                JP DECI

NOISE:          LD A,(BUFF+7)      ;NO DRUMS IF FX NOISE ON CHAN 3
                AND %00100000      ;Gate open if bit NOT set
                JR Z,DECI
NOISENOCHECK:   LD A,1
                LD (NSEFLAG),A
                LD   A,E
                LD   (BUFF+6),A
                JP   DECI

NEWKEY:         LD   (IX+PITCHSHIFT),E
                JP   DECI

NEWENT:         CALL FINDENV
                LD (IX+ENTADR),C
                LD (IX+ENTADR+1),B
                JP DECI

NEWENV:         CALL FINDENV
                LD (IX+ENVADR),C
                LD (IX+ENVADR+1),B
                JP DECI

NEWENSE:        CALL FINDENV
                LD (ENSSTORE+12),BC
                JP DECI

GONEWBLOC:      LD   (IX+CONPTR+1),H
                LD   (IX+CONPTR),L
                CALL FINDBLOC
                JP   DECI

RETCONBLOC      LD   H,(IX+CONPTR+1)
                LD   L,(IX+CONPTR)
                LD A,(HL)
                INC A     ;TEST 255
                JP NZ,DECI
                LD H,(IX+PTRREFR+1)
                LD L,(IX+PTRREFR)
                JP DECI

OVERIDE         LD A,E
                LD (OVERIDER+1),A
                JP DECI

SETINTERVAL     LD (IX+INTERVAL),E
                JP DECI
;-----------------------------------------DO NOTEs--------
COMPNOTE:       AND 127
                DEC HL
                LD E,(IX+CURRENTDUR)

NEWNOTE:        ADD  A,(IX+PITCHSHIFT)

;*******
IF SPECVERSION
                SUB 12       ;HALVE FREQY IF SPECTRUM (AY CLOCKED AT 2 MHZ)
ENDIF
;*******

DOPAUSE:        LD   (IX+MAINCOUNT),E
                LD   (IX+CURRENTDUR),E
                LD   (IX+CURRENTNOTE),A
                LD   (IX+DATAPTR+1),H
                LD   (IX+DATAPTR),L

PITCHTAB        EQU  SOUNDATA
                ADD  A,A
                ADD  A,PITCHTAB AND #00FF
                LD   L,A
                ADC  A,PITCHTAB AND #FF00 /256
                SUB  L
                LD   H,A
                LD   DE,PITCHTEMP
                LDI
                LDI

                LD (IY+6),0   ;+6 for volbal

                PUSH IX           ;RESTART ENV/ent
                POP  DE
                LD   HL,8
                ADD  HL,DE
                LDI
                LDI
                LDI
                LDI
                LDI
                LDI
                LDI
                LDI

                XOR A
                LD HL,NSEFLAG
                OR  (HL)
                LD (HL),0
                LD   L,(IX+NOISEDIS)
                JR   Z,GATING

NOISEON:        LD  HL,(ENSSTORE+ENVADR)
                LD  (ENSSTORE+ENVPTR),HL
                LD  HL,00
                LD  (ENSSTORE),HL

GATING:         LD   A,(BUFF+7)
                AND  (IX+CH_ENABLE)
                OR   L
OVERIDER        OR  0-0             ;SELF MODABLE
                AND  %00111111      ;TOP 2 BITS OFF
                LD   (BUFF+7),A
;---------------------------------------------------

DOENV_ENT:      CALL ENGEN

                LD A,(IY+6)  ;would-be vol store
                ADD A,C
                SUB  128
                ld (iy+6),a  ;replace would-be
                ld c,a
                ld a,(ix+volbalflag)
                or a
                ld a,c

                jr nz,tune
                ld hl,effvol
                jp bal
tune            ld hl,tunvol

bal             sub (hl)
                jr nc,setvol
                ld a,0
setvol          LD   (IY+0),A

;-------------------
                LD HL,(PITCHTEMP)     ;PAUSE ?
                LD A,H
                OR L
                RET Z
                LD A,(IX+INTERVAL)    ;CHORD ?
                OR A
                JR NZ,DOCHORD
DOENT:          INC IX
                INC IX
                CALL ENGEN
                LD HL,(PITCHTEMP)
                LD B,0
;*************************
IF SPECVERSION
                ADD  HL,BC
                ADD HL,BC
                LD   C,128
                SBC HL,BC
                SBC  HL,BC
ELSE
                ADD HL,BC
                LD C,128
                SBC HL,BC
ENDIF
;************************
                RET
;--------------------------------------
DOCHORD:        DEC (IX+CHORDTOGGLE)
                LD A,(IX+CURRENTNOTE)
                JR Z,FINDSETPITCH
                ADD (IX+INTERVAL)
                LD (IX+CHORDTOGGLE),1

;PITCHTAB        EQU  SOUNDATA
FINDSETPITCH:   ADD  A,A
                ADD  A,PITCHTAB AND #00FF
                LD   L,A
                ADC  A,PITCHTAB AND #FF00 /256
                SUB  L
                LD   H,A

                LD   E,(HL)
                INC HL
                LD  D,(HL)
                EX HL,DE
                RET
;-------------------
DOENSE:         LD IX,ENSSTORE
                CALL ENGEN

                LD HL, BUFF+6
                LD   A,(HL)
                ADD  A,C
                SUB  128
                LD   (HL),A
                CP 32
                RET C
NOISEOFF:       INC HL          ;HL=BUFF+7
                LD A,(HL)
                OR %00111000
                LD (HL),A
                RET
;--------------------------------------
ENGEN           PUSH IX
                POP  HL
                LD   D,(IX+ENVPTR+1)
                LD   E,(IX+ENVPTR)
                INC  (HL)
                LD   A,(DE)
                SUB  (HL)
                LD C,128        ;=0!
                RET  NZ
                LD   (HL),A
                INC DE
                LD  A,(DE)
                LD C,A
                INC  DE
                INC  HL
                INC  (HL)
                LD   A,(DE)
                SUB  (HL)
                RET  NZ
                LD   (HL),A
                INC  DE
                LD   A,(DE)
                INC  A
                JR   NZ,NEXTSECT
                LD   D,(IX+ENVADR+1)
                LD   E,(IX+ENVADR)
NEXTSECT:       LD   (IX+ENVPTR+1),D
                LD   (IX+ENVPTR),E
                RET

;---------------------

BUFF:     DW  00
          DW  00
          DW  00
          DB  0
          DB  %00111111
          DB  0
          DB  0
          DB  0
          Dw  16
          DB  10

wouldbe   db 0
          db 0
          db 0

PITCHTEMP:  DW 00

NSEFLAG:    DB 0

ENSSTORE: DW 00
          DW 10
          DW 00
          DW 04
          DW 00
          DW 18
          DW 00

;-----CHANNEL STORES

STORE1:   DW  00
          DW  00
          DW  00
          DW  00

          DW  00
          DW  00
          DW  00
          DW  00

          DB  0
          DB  0
          DW  00
          DW  00
          DW  00
          DB  0
          DB   8          ;NOISE DIS
          DB  32+16+4+2   ;CHAN ENABLE  (-4 'COS CHORUS=CH3 ALWAYS ON)
          DB  0
          DB  0
          DB  0
          DB  0
          db  0  ;volbalflag

STORE2: DW  00
        DW  00
        DW  00
        DW  00

        DW  00
        DW  00
        DW  00
        DW  00

        DB  0
        DB  0
        DW  00
        DW  00
        DW  00
        DB  0
        DB  16
        DB  32+8+4+1
        DB  0
        DB  0
        DB  0
        DB  0
        db  0

STORE3: DW  00
        DW  00
        DW  00
        DW  00

        DW  00
        DW  00
        DW  00
        DW  00

        DB  0
        DB  0
        DW  00
        DW  00
        DW  00
        DB  0
        DB  32
        DB  16+8+2+1
        DB  0
        DB  0
        DB  0
        DB  0
        db  0

;---------------------48K SOUND----------------
SOUNDATA
;	db #2a,#ff,#ff,#ff,#ff
	db #00,#00
	dw #0f25,#0e4c,#0d7e,#0cbd
	dw #0c06,#0b59,#0ab6,#0a1c
	dw #098b,#0902,#0880,#0806
	dw #0793,#0726,#06bf,#065e
	dw #0603,#05ac,#055b,#050e
	dw #04c5,#0481,#0440,#0403
	dw #03c9,#0393,#0360,#032f
	dw #0301,#02d6,#02ad,#0287
	dw #0263,#0240,#0220,#0202
	dw #01e5,#01c9,#01b0,#0198
	dw #0181,#016b,#0157,#0143
	dw #0131,#0120,#0110,#0101
	dw #00f2,#00e5,#00d8,#00cc
	dw #00c0,#00b6,#00ab,#00a2
	dw #0099,#0090,#0088,#0080
	dw #0079,#0072,#006c,#0066
	dw #0060,#005b,#0056,#0051
	dw #004c,#0048,#0044,#0040
	dw #003d,#0039,#0036,#0033
	dw #0030,#002d,#002b,#0028
	dw #0026,#0024,#0022,#0020
	dw #001e,#001d,#001b,#0019
	dw #0018,#0017,#0015,#0014
	dw #0013,#0012,#0011,#0010
	dw #000f,#000e,#0000
	db #9a,#01,#9e,#01,#a8,#01,#bb,#01
	db #c5,#01,#cc,#01,#dc,#01,#e3,#01
	db #ed,#01,#f7,#01,#01,#02,#0b,#02
	db #12,#02,#25,#02,#26,#02,#30,#02
	db #3a,#02,#3b,#02,#45,#02,#4f,#02
	db #53,#02,#54,#02,#5b,#02,#62,#02
	db #6c,#02,#73,#02,#7d,#02,#90,#02
	db #91,#02,#92,#02,#93,#02,#94,#02
	db #9e,#02,#a5,#02,#b2,#02,#b9,#02
	db #c0,#02,#c7,#02,#d1,#02,#d8,#02
	db #e2,#02,#e9,#02,#ed,#02,#ee,#02
	db #fe,#02,#1a,#03,#1b,#03,#25,#03
	db #29,#08,#3b,#08,#2a,#03,#2e,#03
	db #19,#04,#be,#04,#e4,#04,#ef,#04
	db #fa,#04,#22,#05,#3e,#05,#5d,#05
	db #7b,#05,#96,#05,#ad,#05,#c3,#05
	db #14,#06,#68,#06,#91,#06,#92,#06
	db #93,#06,#94,#06,#a1,#06,#bb,#06
	db #c0,#06,#ec,#06,#fc,#06,#26,#07
	db #52,#07,#77,#07,#78,#07,#89,#07
	db #97,#07,#a5,#07,#b7,#07,#c5,#07
	db #d3,#07,#e5,#07,#f3,#07,#01,#08
	db #0f,#08,#10,#08,#1e,#08,#2c,#08
	db #2d,#08,#2e,#08,#38,#08,#4a,#08
	db #54,#08,#5f,#08,#6a,#08,#79,#08
	db #7a,#08,#7b,#08,#ad,#08,#de,#08
	db #4a,#09,#c8,#80,#c8,#ff,#01,#8a
	db #01,#02,#7a,#01,#01,#7c,#01,#ff
	db #01,#8b,#01,#01,#7f,#03,#01,#81
	db #03,#01,#7f,#03,#01,#81,#03,#c8
	db #80,#c8,#ff,#01,#8f,#01,#01,#7f
	db #02,#c8,#80,#c8,#ff,#01,#8d,#01
	db #14,#7f,#0b,#ff,#01,#8e,#01,#01
	db #81,#01,#01,#7f,#01,#05,#7f,#09
	db #c8,#80,#c8,#ff,#01,#8b,#01,#14
	db #7f,#0a,#ff,#01,#8d,#01,#01,#7f
	db #0b,#c8,#80,#c8,#ff,#01,#8d,#01
	db #01,#7f,#07,#c8,#80,#c8,#ff,#01
	db #8c,#01,#01,#7f,#04,#14,#7f,#08
	db #ff,#01,#92,#01,#01,#7e,#09,#c8
	db #80,#c8,#ff,#01,#89,#01,#28,#7f
	db #09,#ff,#01,#82,#01,#01,#7e,#02
	db #01,#82,#01,#01,#83,#01,#01,#7d
	db #02,#01,#83,#01,#ff,#ff,#01,#82
	db #01,#01,#7c,#01,#01,#82,#01,#ff
	db #01,#83,#01,#01,#7a,#01,#01,#83
	db #01,#ff,#ff,#01,#50,#01,#01,#98
	db #02,#c8,#80,#c8,#ff,#01,#80,#01
	db #01,#b4,#01,#c8,#80,#c8,#ff,#01
	db #81,#c8,#ff,#ff,#01,#fa,#02,#01
	db #06,#02,#ff,#01,#81,#02,#01,#7f
	db #03,#ff,#01,#8d,#01,#01,#7f,#05
	db #04,#7f,#08,#ff,#01,#9d,#02,#01
	db #69,#02,#ff,#01,#87,#02,#01,#7e
	db #04,#c8,#80,#c8,#ff,#01,#8d,#01
	db #01,#82,#01,#01,#7f,#02,#02,#7f
	db #02,#03,#7f,#07,#c8,#80,#c8,#ff
	db #ff,#ff,#ff,#ff,#01,#84,#01,#01
	db #83,#03,#c8,#80,#c8,#ff,#01,#69
	db #09,#02,#91,#03,#ff,#01,#8d,#01
	db #01,#82,#01,#01,#7e,#02,#02,#7f
	db #07,#ff,#02,#a3,#05,#02,#49,#06
	db #ff,#01,#8f,#01,#c8,#80,#c8,#ff
	db #01,#68,#02,#02,#82,#04,#ff,#01
	db #86,#02,#01,#8a,#01,#c8,#80,#c8
	db #ff,#01,#78,#06,#01,#88,#c8,#ff
	db #01,#85,#03,#02,#7f,#04,#08,#7f
	db #0c,#ff,#01,#96,#02,#01,#69,#02
	db #ff,#02,#7f,#0d,#ff,#ff,#01,#89
	db #01,#01,#7e,#03,#02,#81,#06,#01
	db #7e,#03,#c8,#80,#c8,#ff,#01,#81
	db #01,#01,#7f,#01,#01,#81,#01,#01
	db #7f,#01,#01,#81,#01,#01,#7f,#01
	db #01,#81,#01,#01,#7f,#01,#01,#8a
	db #c8,#ff,#ff,#01,#89,#01,#0d,#7f
	db #09,#c8,#80,#c8,#ff,#04,#22,#c8
	db #ff,#7f,#fe,#ff,#ff,#01,#01,#f4
	db #14,#02,#02,#03,#00,#ef,#01,#e8
	db #ed,#00,#ec,#00,#ee,#07,#ee,#07
	db #e9,#05,#03,#07,#ee,#04,#03,#06
	db #ee,#05,#03,#06,#ee,#04,#03,#06
	db #ee,#04,#03,#06,#ee,#05,#03,#09
	db #ee,#04,#03,#06,#ee,#04,#03,#06
	db #ee,#04,#03,#09,#ee,#04,#03,#08
	db #e9,#08,#ee,#04,#e9,#05,#ed,#00
	db #03,#06,#ee,#04,#03,#06,#ee,#04
	db #03,#06,#ee,#05,#03,#06,#ee,#04
	db #03,#06,#ee,#05,#03,#06,#ee,#04
	db #03,#09,#ee,#04,#03,#08,#e9,#08
	db #ee,#04,#03,#03,#e9,#06,#ec,#07
	db #ed,#09,#ee,#04,#ee,#04,#ed,#06
	db #ee,#04,#ee,#04,#ed,#03,#ee,#04
	db #e9,#0b,#ee,#04,#ee,#04,#ee,#04
	db #e9,#09,#ed,#00,#ee,#0d,#e9,#03
	db #ee,#0d,#e9,#03,#ec,#0c,#ee,#0d
	db #e9,#09,#ed,#07,#ee,#0d,#e9,#03
	db #ed,#00,#ee,#0d,#ec,#0c,#e9,#08
	db #ee,#19,#e9,#03,#ed,#03,#ee,#19
	db #ed,#00,#e9,#1a,#ee,#16,#ee,#19
	db #ee,#16,#ee,#19,#ee,#19,#02,#13
	db #28,#20,#e9,#0b,#28,#a0,#03,#00
	db #ee,#14,#ed,#00,#ee,#14,#ee,#14
	db #ed,#03,#ee,#14,#02,#08,#ee,#14
	db #ed,#06,#ee,#14,#ed,#09,#ee,#14
	db #ed,#0c,#ee,#14,#ed,#0f,#ee,#14
	db #02,#15,#00,#2c,#00,#02,#ee,#10
	db #ff,#ef,#01,#e8,#e9,#00,#00,#5c
	db #ea,#11,#00,#03,#e9,#02,#e8,#ee
	db #0b,#00,#01,#e9,#02,#ed,#0c,#00
	db #0c,#ea,#0a,#ee,#0a,#e9,#08,#ed
	db #07,#ee,#04,#ea,#0a,#ed,#00,#e9
	db #02,#ee,#0a,#ed,#07,#e9,#08,#ee
	db #04,#ec,#0c,#ed,#09,#ee,#07,#ee
	db #08,#ed,#06,#ee,#07,#ee,#08,#ed
	db #03,#e9,#0b,#00,#08,#c0,#ee,#0c
	db #ee,#0c,#ee,#0c,#3c,#04,#bb,#39
	db #08,#34,#04,#b2,#b0,#af,#ad,#ec
	db #00,#e9,#08,#ea,#0f,#00,#7c,#4d
	db #c0,#ed,#0c,#e9,#04,#ea,#00,#ee
	db #0e,#e9,#09,#ec,#0c,#00,#04,#ee
	db #0e,#e9,#06,#ed,#13,#ec,#00,#00
	db #08,#ee,#0e,#e9,#09,#ed,#0c,#00
	db #04,#ee,#0e,#ea,#0c,#e9,#02,#ee
	db #08,#ee,#08,#00,#20,#ed,#0f,#ee
	db #1a,#ec,#18,#ed,#0c,#e9,#06,#ee
	db #17,#ee,#1a,#ee,#17,#ee,#1a,#ed
	db #18,#e9,#09,#ee,#0d,#ff,#ef,#01
	db #e9,#06,#ed,#09,#ee,#04,#ee,#04
	db #ed,#06,#ee,#04,#ee,#04,#ed,#0f
	db #e9,#0b,#ee,#04,#ee,#04,#ee,#04
	db #00,#c8,#00,#c8,#ff,#04,#ee,#04
	db #00,#c8,#00,#c8,#ea,#0c,#21,#18
	db #21,#04,#9f,#9c,#1f,#0c,#ff,#ea
	db #0c,#21,#18,#23,#04,#a4,#9c,#1f
	db #0c,#ff,#ef,#01,#e9,#07,#ec,#0c
	db #eb,#00,#e7,#19,#39,#08,#e7,#19
	db #30,#04,#e7,#13,#00,#04,#e7,#0d
	db #b0,#e7,#07,#b2,#e7,#01,#b0,#b2
	db #e9,#08,#e7,#0f,#b9,#e7,#07,#37
	db #0c,#ff,#ef,#01,#e9,#09,#ea,#0e
	db #eb,#12,#e7,#01,#3c,#08,#e7,#01
	db #b4,#e7,#01,#bb,#e7,#01,#b4,#e7
	db #01,#b9,#e7,#01,#b4,#ff,#ef,#01
	db #e9,#09,#eb,#12,#e7,#01,#00,#08
	db #e7,#01,#00,#08,#e7,#01,#00,#08
	db #e7,#01,#00,#08,#e7,#01,#00,#08
	db #e7,#01,#00,#08,#ff,#ef,#01,#e9
	db #09,#ec,#0c,#eb,#12,#e7,#01,#48
	db #08,#e7,#01,#c0,#e7,#01,#c7,#e7
	db #01,#c0,#e7,#01,#c5,#e7,#01,#c0
	db #00,#7c,#ff,#39,#1f,#ea,#0c,#39
	db #20,#38,#10,#bc,#37,#30,#b7,#36
	db #20,#32,#10,#35,#20,#2d,#10,#ea
	db #0a,#30,#30,#00,#01,#ff,#39,#04
	db #b9,#b9,#b9,#b8,#bc,#b7,#b7,#b7
	db #37,#0c,#36,#08,#32,#04,#35,#08
	db #2d,#04,#30,#0c,#ff,#eb,#12,#e6
	db #01,#48,#08,#e6,#01,#c0,#e6,#01
	db #c7,#e6,#01,#c0,#e6,#01,#c5,#e6
	db #01,#c0,#ff,#03,#0f,#ec,#0f,#1d
	db #08,#1d,#10,#1d,#08,#1f,#04,#9f
	db #1f,#10,#1f,#08,#03,#0f,#ec,#10
	db #a0,#20,#10,#20,#08,#ec,#0f,#a2
	db #22,#10,#22,#08,#03,#0f,#ec,#10
	db #24,#04,#a4,#24,#10,#24,#08,#a5
	db #25,#10,#24,#08,#03,#0f,#ec,#0f
	db #9f,#1f,#10,#1f,#08,#22,#04,#a2
	db #22,#10,#22,#08,#03,#0f,#ec,#10
	db #a4,#24,#10,#24,#08,#ec,#07,#a4
	db #a2,#a0,#9f,#ff,#24,#03,#29,#04
	db #ab,#ac,#a4,#a9,#ab,#ac,#a4,#a9
	db #a4,#a9,#a2,#a9,#a2,#a9,#a4,#a9
	db #ab,#ac,#a4,#a9,#ab,#ac,#ae,#a5
	db #a9,#ae,#ac,#a5,#ae,#a9,#b0,#ae
	db #ac,#ab,#a8,#a9,#ab,#a8,#ab,#ac
	db #ab,#a9,#a5,#a7,#a4,#a5,#a2,#a5
	db #a9,#ab,#a9,#a5,#a2,#a5,#ab,#a5
	db #ab,#a5,#a9,#a2,#a5,#a2,#a4,#a9
	db #ab,#ac,#a4,#a9,#ab,#ac,#a4,#a5
	db #a2,#a4,#a0,#a2,#9f,#00,#01,#ff
	db #ef,#01,#eb,#00,#e9,#01,#ec,#05
	db #e6,#03,#48,#04,#00,#04,#e6,#03
	db #c8,#00,#0c,#e6,#03,#48,#04,#00
	db #04,#e6,#03,#c8,#e6,#03,#c8,#e6
	db #03,#c8,#00,#04,#ae,#ac,#ab,#a9
	db #ff,#ff,#fe,#fe,#ef,#01,#e9,#09
	db #ec,#0f,#22,#08,#22,#10,#22,#08
	db #ff,#e9,#2b,#ec,#03,#eb,#12,#e6
	db #01,#43,#08,#e6,#01,#bd,#e6,#01
	db #c0,#e6,#01,#ba,#e6,#01,#bd,#e6
	db #01,#b7,#ff,#ef,#01,#ee,#14,#fe
	db #03,#18,#20,#08,#20,#04,#a0,#20
	db #08,#20,#04,#a0,#a0,#a0,#a0,#a0
	db #1f,#08,#1f,#04,#9f,#03,#18,#1d
	db #08,#1d,#04,#9d,#1d,#08,#1d,#04
	db #9d,#1d,#08,#1d,#04,#9d,#1d,#08
	db #1d,#04,#9d,#ff,#29,#08,#28,#10
	db #a7,#24,#0c,#a7,#2b,#18,#27,#10
	db #24,#0c,#a5,#ff,#ef,#01,#e9,#05
	db #eb,#13,#e7,#01,#00,#10,#e9,#02
	db #ea,#0e,#3f,#08,#3d,#04,#bf,#e9
	db #05,#e7,#01,#00,#10,#e9,#08,#e7
	db #07,#00,#08,#e7,#07,#00,#04,#e7
	db #07,#00,#04,#00,#7c,#ff,#03,#18
	db #19,#08,#19,#04,#a5,#19,#08,#19
	db #04,#a5,#19,#08,#19,#04,#a5,#99
	db #99,#99,#a5,#03,#18,#1b,#08,#1b
	db #04,#a7,#1b,#08,#1b,#04,#a7,#1c
	db #08,#1c,#04,#a8,#1c,#08,#1c,#04
	db #a8,#ff,#27,#03,#25,#04,#ab,#a5
	db #a7,#a5,#ab,#a5,#a7,#a5,#ab,#a5
	db #a7,#a5,#ab,#a5,#a7,#a5,#ac,#a5
	db #a7,#a5,#ac,#a5,#a8,#a5,#ac,#a5
	db #a8,#a5,#ac,#a5,#00,#01,#ff,#fe
	db #01,#f4,#14,#02,#1d,#03,#1e,#e9
	db #2e,#ea,#2c,#41,#14,#b5,#29,#19
	db #fe,#f4,#14,#e9,#2e,#ea,#2c,#00
	db #02,#44,#14,#b8,#2c,#19,#fe,#f4
	db #14,#e9,#2e,#ea,#2c,#00,#04,#47
	db #14,#bb,#2f,#19,#fe,#01,#f4,#14
	db #02,#20,#03,#21,#e9,#2b,#ea,#00
	db #39,#0c,#c8,#cb,#43,#24,#fe,#f4
	db #14,#e9,#2b,#ea,#00,#00,#04,#40
	db #0c,#c7,#4a,#24,#fe,#f4,#14,#e9
	db #2b,#ea,#00,#00,#08,#45,#0c,#c5
	db #48,#24,#fe,#04,#f4,#14,#e9,#1a
	db #ea,#15,#eb,#16,#e7,#1b,#13,#02
	db #e7,#0b,#2b,#21,#fe,#04,#f4,#14
	db #e9,#1a,#ea,#15,#eb,#16,#e7,#1b
	db #37,#25,#fe,#04,#f4,#14,#e9,#1a
	db #ea,#15,#eb,#16,#e7,#13,#0c,#2c
	db #fe,#04,#f4,#0a,#e9,#17,#ea,#18
	db #eb,#19,#e7,#01,#4e,#0c,#fe,#fe
	db #04,#f4,#0a,#e9,#17,#ea,#18,#eb
	db #19,#e7,#01,#62,#0c,#fe,#02,#f4
	db #1e,#e9,#00,#00,#f4,#00,#f4,#00
	db #f4,#00,#f4,#ff,#fe,#fe,#04,#f4
	db #14,#e9,#1f,#ea,#20,#32,#08,#fe
	db #04,#f4,#14,#e9,#19,#ea,#2f,#eb
	db #2f,#e7,#03,#37,#09,#e7,#03,#00
	db #02,#fe,#04,#f4,#02,#e9,#21,#ea
	db #22,#18,#11,#fe,#04,#f4,#14,#e9
	db #23,#ea,#24,#e8,#4a,#08,#fe,#04
	db #f4,#14,#e9,#27,#ea,#26,#e8,#33
	db #0f,#fe,#04,#f4,#14,#e9,#27,#ea
	db #28,#eb,#29,#e8,#e7,#13,#52,#3f
	db #fe,#fe,#fe,#fe,#00,#00,#18,#03
	db #c3,#e6,#6e,#2a,#fb,#6e,#22,#7d
	db #b7,#dd,#7e,#00,#dd,#23,#21,#00
	db #2e,#57,#af,#5f,#cb,#1a,#cb,#1b
	db #cb,#1a,#cb,#1b,#19,#2d,#2d,#dd
	db #2b,#c3,#7c,#b7,#00,#2a,#fb,#6e
	db #22,#7d,#b7,#dd,#7e,#00,#dd,#23
	db #21,#00,#2e,#57,#af,#5f,#cb,#1a
	db #cb,#1b,#cb,#1a,#cb,#1b,#19,#11
	db #02,#c0,#4b,#7a,#2c,#2c,#ed,#a0
	db #4b,#ed,#a0,#ed,#53,#fb,#6e,#59
	db #80,#57,#2c,#2c,#ed,#a0,#4b,#ed
	db #a0,#59,#80,#57,#2c,#2c,#ed,#a0
	db #4b,#ed,#a0,#59,#80,#57,#2c,#2c
	db #ed,#a0,#4b,#ed,#a0,#59,#80,#57
	db #2c,#2c,#ed,#a0,#4b,#ed,#a0,#59
	db #80,#57,#2c,#2c,#ed,#a0,#4b,#ed
	db #a0,#59,#80,#57,#2c,#2c,#ed,#a0
	db #4b,#ed,#a0,#59,#80,#57,#2c,#2c
	db #ed,#a0,#4b,#ed,#a0,#79,#c6,#40
	db #5f,#3e,#c8,#8a,#57,#00,#2c,#2c
	db #ed,#a0,#4b,#ed,#a0,#59,#80,#57
	db #2c,#2c,#ed,#a0,#4b,#ed,#a0,#59
	db #80,#57,#2c,#2c,#ed,#a0,#4b,#ed
	db #a0,#59,#80,#57,#2c,#2c,#ed,#a0
	db #4b,#ed,#a0,#59,#80,#57,#2c,#2c
	db #ed,#a0,#4b,#ed,#a0,#59,#80,#57
	db #2c,#2c,#ed,#a0,#4b,#ed,#a0,#59
	db #80,#57,#2c,#2c,#ed,#a0,#4b,#ed
	db #a0,#59,#80,#57,#4a,#2c,#2c,#ed
	db #a0,#ed,#a0,#c9,#33,#00,#33,#08
	db #b7,#02,#f7,#06,#77,#03,#77,#8b
	db #37,#2b,#37,#6f,#37,#37,#37,#b7
	db #37,#b3,#37,#f3,#67,#73,#67,#73
	db #67,#39,#67,#39,#00,#63,#00,#67
	db #00,#67,#00,#67,#00,#67,#00,#67
	db #00,#67,#00,#67,#00,#67,#08,#67
	db #02,#67,#06,#67,#03,#67,#8b,#67
	db #2b,#67,#6f,#67
;INTRO48         RET
;INGAME48        RET
;SPARE           DB 42

;---------
FINISH          DEFL $
;                LIST
;                CLOSE
;START           DEFL START
;FINISH          DEFL FINISH
LENGTH          DEFL FINISH-START

.game_name
	db "Netherworld",0
.game_year
	db "1988",0
.game_publisher
	db "Hewson",0
.music_author
	db "Dave Rogers",0
.music_comment
	db "NETHERSD.ASM V 11.0 NETHERWORLD Sound Driver (AMSTRAD/SPEC.128) DavRog,1988",0

	read "music_end_v1_0.asm"
